import { ContentType } from '@/enums/httpEnum';
import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile';

// 查询告警信息列表
export async function getAlarmList(params?: API.Manage.AlarmListParams) {
  return request<API.Manage.AlarmPageResult>('/api/inspection/alarmInfo/list', {
    method: 'GET',
    headers: { 'Content-Type': ContentType.FORM_URLENCODED },
    params
  });
}
//新增告警
export function addAlarm(params: API.Manage.Alarm) {
  return request<API.Result>('/api/inspection/alarmInfo/add', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json;charset=UTF-8',
    },
    data: params,
  });
}

//更新告警
export function updateAlarm(params: API.Manage.Alarm) {
    return request<API.Result>('/api/inspection/alarmInfo/update', {
      method: 'POST',
      headers: {
          'Content-Type': 'application/json;charset=UTF-8',
      },
      data: params,
    });
  }

// 删除告警信息
export async function removeAlarm(ids: number[]) {
  return request<API.Result>('/api/inspection/alarmInfo/delete', {
    method: 'POST',
    data: ids
  });
}